package com.es.designmode.strategy;

/**
 * 策略模式
 *
 * @author Will
 */
public class ClientSide {

    public static void main(String[] args) {

        // 1、策略实现
        Context context;

        // 策略A
        context = new Context(new ConcreteStrategyA());
        context.ContextInterface();

        // 策略B
        context = new Context(new ConcreteStrategyB());
        context.ContextInterface();


        // 2、工厂+策略实现
        new ContextFactory('a').Algorithm();
        new ContextFactory('b').Algorithm();
    }
}
